package com.baosight.risk.web.riri;

import com.baosight.risk.api.riri.IRiriRiskService;
import com.baosight.risk.base.controller.BaseController;
import com.baosight.risk.service.riri.entity.RiriRisk;
import com.baosight.risk.service.riri.vo.RiriRiskVO;

import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Slf4j
@RestController
@RequestMapping("/riri/interface")
public class RiriRiskInterfaceController extends BaseController {

    @Autowired
    private IRiriRiskService ririRiskService;

    /**
     * TOP3风险事项库查询服务接口
     * @param vo
     * @return
     */
    @PostMapping("queryRiriRiskData")
    public Object queryRiriRiskData(@RequestBody RiriRiskVO vo) {
        Map data=new HashMap<>();
        data.put("status","1");
        data.put("message","查询成功");
        try{
            List<RiriRisk> riskList =ririRiskService.queryRiriRiskData(vo);
            data.put("riskList",riskList);
        }catch (Exception e){
            data.put("status","0");
            data.put("message",e.getMessage());
        }
        return data;
    }


}
